﻿/*
 * Created by SharpDevelop.
 * User: alex
 * Date: 22.01.2012
 * Time: 19:27
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */
using System;
using System.Collections.Generic;
using System.Drawing;

namespace DrawTest
{
	/// <summary>
	/// Description of AirCraft.
	/// </summary>
	public class AirCraft : FlyingObject
	{
		public AirCraft()
		{
		}
		
		public void initAirCraft(string imagePath, int meanSpeed, MyPoint startPoint, MyPoint endPoint, int necessaryTime){
			
			numTimerTick(necessaryTime);
			initializeFlying(imagePath, meanSpeed);
			
			objectPath = findPath(startPoint, endPoint);
		}
		
		
		public void drawAirCraft(Graphics dc, int currentAngle){
			if (numOfTick == 0) {
				nextMove();
				drawObject(dc, currentAngle);
			} else {
				numOfTick -= 1;
			}
		}
		
		public void numTimerTick(int necessaryTime){
			
			if (necessaryTime < 0){
				necessaryTime = Math.Abs(necessaryTime);
			}
			
			double tickDouble = necessaryTime*1000 / Consts.TimerInterval;
			numOfTick = (int)Math.Round(tickDouble);
			
		}
		
		public Boolean Civil{ get; set; }
		
		protected int numOfTick = -1;
		
	}
}
